package com.xmy.cultivate.controller;

import com.xmy.cultivate.entity.TryJobPopUpLog;
import com.xmy.cultivate.service.ITryJobPopUpLogService;
import com.xmy.cultivate.util.Code;
import com.xmy.cultivate.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 试岗数据弹窗记录表 前端控制器
 * </p>
 *
 * @author hpiggy
 * @since 2025-03-26
 */
@RestController
@RequestMapping("/api/tryJobPopUpLog")
public class TryJobPopUpLogController {

    @Autowired
    ITryJobPopUpLogService iTryJobPopUpLogService;

    @PostMapping("/addTryJobPopUpLog")
    public Result addTryJobPopUpLog(@RequestBody List<TryJobPopUpLog> tryJobPopUpLog){
        boolean saveBatch = iTryJobPopUpLogService.saveBatch(tryJobPopUpLog);
        if (saveBatch){
            return new Result(Code.OK,"", "添加成功");
        }else {
            return new Result(Code.ERROR,"", "添加失败");
        }

    }

}
